package com.sunni.service.Impl;

import com.sunni.entity.User;
import com.sunni.service.UserService;
import com.sunni.dao_old.UserDao;

import java.util.List;
import java.util.Map;
import java.util.Properties;

public class UserServiceImpl implements UserService {

    private UserDao userDao;

    // set方法 注入
    public void setUserDao(UserDao userDao){
        this.userDao=userDao;
    }

    // 构造器 注入
/*    public UserServiceImpl(UserDao userDao) {
        this.userDao = userDao;
    }*/

    /*普通属性注入*/
    private int age;
    public void setAge(int age) {
        this.age = age;
    }

    /*集合属性注入*/
    private List<String> strList;
    private Map<String,User> userMap;
    private Properties properties;

    public void setStrList(List<String> strList) {
        this.strList = strList;
    }

    public void setUserMap(Map<String, User> userMap) {
        this.userMap = userMap;
    }

    public void setProperties(Properties properties) {
        this.properties = properties;
    }


    @Override
    public void save() {
        System.out.println("[userService.strList]==="+strList);
        System.out.println("[userService.userMap]==="+userMap);
        System.out.println("[userService.properties]==="+properties);
        userDao.save();
    }
}
